﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//  边缘交点

namespace Vision.src
{
    // 定义事件参数
    public class CaliperCornerEventArgs : EventArgs
    {
        public float CaliperCornerX { get; }
        public float CaliperCornerY { get; }

        public CaliperCornerEventArgs(float caliperCornerX, float caliperCornerY)
        {
            CaliperCornerX = caliperCornerX;
            CaliperCornerY = caliperCornerY;
        }
    }

    // 定义委托
    public delegate void CaliperCornerEventHandler(CaliperCorner CaliperCorner, CaliperCornerEventArgs e);

    public class CaliperCorner
    {
        private CaliperCornerEventHandler caliperCornerEventHandler;

        public event CaliperCornerEventHandler Order
        {
            add
            {
                this.caliperCornerEventHandler += value;
            }
            remove
            {
                this.caliperCornerEventHandler -= value;
            }
        }

        public void ReturnResult(CaliperCornerEventArgs e)
        {
            this.caliperCornerEventHandler?.Invoke(this, e);
        }
    }
}
